package exceptionHomework;

public class ThrowDemo {
    public static void main(String[] args) {
        Student ls=new Student();
        try{
            ls.setAge(25);
            System.out.println("此人年龄为："+ls.getAge()+"岁");
        }catch (Exception e){
            System.out.println("年龄不合法");
        }
    }
}
